<extend name="Usercenter/index"/>

<block name="main">
    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">收货地址管理</li>
            <li>新增地址</li>
        </ul>
        <div class="layui-tab-content">
            <!--地址列表-->
            <div class="layui-tab-item layui-show">
                <if condition="$list eq null">
                    <div class="tr non-info show border-bottom-none">
                        <span>暂时没有地址</span>
                    </div>
                    <else />
                    <table class="layui-table">
                        <colgroup>
                            <col >
                            <col >
                            <col>
                        </colgroup>
                        <thead>
                        <tr>
                            <th >姓名</th>
                            <th >电话</th>
                            <th >地址</th>
                            <th >创建时间</th>
                            <!--<th >开始时间</th>-->
                            <!--<th >过期时间</th>-->
                            <td>操作</td>
                        </tr>
                        </thead>
                        <tbody>
                        <foreach name="list" item="vo" key="k">
                            <tr>
                                <td>{{$vo.name}}</td>
                                <td>{{$vo.tel}}</td>
                                <td>{{$vo.address}}</td>
                                <td>{{$vo.create_time}}</td>
                                <!--<td>{{$vo.begin_time}}</td>-->
                                <!--<td>{{$vo.end_time}}</td>-->
                                <td>
                                    <a href="{{:U('Usercenter/addressdel',array('id'=>$vo['id']))}}"class="layui-btn layui-btn-xs layui-btn-radius layui-btn-danger">删除</a>
                                    <!--<if condition="$vo['order'] eq 1">-->
                                        <!--&lt;!&ndash;<a href="{{:U('Usercenter/addressone',array('id'=>$vo['id']))}}"class="layui-btn layui-btn-xs layui-btn-radius ">取消首选地址</a>&ndash;&gt;-->
                                        <!--默认地址-->
                                        <!--<else />-->
                                    <!--<a href="{{:U('Usercenter/addressone',array('id'=>$vo['id']))}}"class="layui-btn layui-btn-xs layui-btn-radius ">设为默认地址</a>-->
                                        <!--</if>-->

                                </td>
                            </tr>
                        </foreach>

                        </tbody>
                    </table>
                </if>
            </div>
            <!--新增地址-->
            <div class="layui-tab-item">
                <div class="view-product">
                    <div class="layui-container" style="margin-top: 20px">
                        <div class="layui-row">

                            <div class="layui-col-md5 layui-col-md-offset1">
                                <form class="layui-form" action="{{:U('Usercenter/addressdo')}}" method="post" enctype="multipart/form-data">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">姓名</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="name" required  lay-verify="required"  autocomplete="off" class="layui-input" >
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">电话</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="tel" required  lay-verify="required"  autocomplete="off" class="layui-input" >
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">地址</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="address" required  lay-verify="required"  autocomplete="off" class="layui-input" >
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <div class="layui-input-block">
                                            <button class="layui-btn" lay-submit >立即提交</button>
                                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                        </div>
                                    </div>
                                </form>

                            </div>
                        </div>
                    </div>
                    <script>
                        //Demo
                        layui.use('form', function(){
                            var form = layui.form;

                            //监听提交
                            form.on('submit(formDemo)', function(data){
                                layer.msg(JSON.stringify(data.field));
                                return false;
                            });
                        });
                    </script>

                    <div class="show-page padding-big-right hidden">
                        <div class="page">
                        </div>
                    </div>
                </div>


            </div>

        </div>
        <script>
            //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
            layui.use('element', function(){
                var element = layui.element;
            });
        </script>
    </div>




</block>